package org.gd.science.kttsoft;

/**
 * @author Gorhover D. P.
 */
public class App {

    public static final int INPUT_RANGE = 3;
    public static final int OUTPUT_RANGE = 17;

    /**
     * Main (Run) method
     * @param args arguments in console
     */
    public static void main(String...args) {
        String inputWord = "122";
        System.out.printf(" input word: %5s (range: %2d)\noutput word: %5s (range: %2d)\n",
                inputWord, INPUT_RANGE,
                MathNotation.convertNotation(inputWord, INPUT_RANGE, OUTPUT_RANGE), OUTPUT_RANGE);
        System.out.println("---------------------------------------------");
        inputWord = "121";
        System.out.printf(" input word: %5s (range: %2d)\noutput word: %5s (range: %2d)\n",
                inputWord, INPUT_RANGE,
                MathNotation.convertNotation(inputWord, INPUT_RANGE, OUTPUT_RANGE), OUTPUT_RANGE);
        System.out.println("---------------------------------------------");
        try {
            inputWord = "1240";
            System.out.printf(" input word: %5s (range: %2d)\noutput word: %5s (range: %2d)\n",
                    inputWord, INPUT_RANGE,
                    MathNotation.convertNotation(inputWord, INPUT_RANGE, OUTPUT_RANGE), OUTPUT_RANGE);
        } catch (IllegalArgumentException e) {
            System.out.println(e);
        }
        System.out.println("---------------------------------------------");
        inputWord = "10210221";
        System.out.printf(" input word: %5s (range: %2d)\noutput word: %5s (range: %2d)\n",
                inputWord, INPUT_RANGE,
                MathNotation.convertNotation(inputWord, INPUT_RANGE, OUTPUT_RANGE), OUTPUT_RANGE);
    }
}
